package com.hxalex.simulationhandle.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.hxalex.simulationhandle.ui.home.model.KeyWordBean;
import com.hxalex.simulationhandle.ui.home.model.TaskBean;
import com.hxalex.simulationhandle.ui.home.model.WebSiteBean;

import com.hxalex.simulationhandle.db.KeyWordBeanDao;
import com.hxalex.simulationhandle.db.TaskBeanDao;
import com.hxalex.simulationhandle.db.WebSiteBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig keyWordBeanDaoConfig;
    private final DaoConfig taskBeanDaoConfig;
    private final DaoConfig webSiteBeanDaoConfig;

    private final KeyWordBeanDao keyWordBeanDao;
    private final TaskBeanDao taskBeanDao;
    private final WebSiteBeanDao webSiteBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        keyWordBeanDaoConfig = daoConfigMap.get(KeyWordBeanDao.class).clone();
        keyWordBeanDaoConfig.initIdentityScope(type);

        taskBeanDaoConfig = daoConfigMap.get(TaskBeanDao.class).clone();
        taskBeanDaoConfig.initIdentityScope(type);

        webSiteBeanDaoConfig = daoConfigMap.get(WebSiteBeanDao.class).clone();
        webSiteBeanDaoConfig.initIdentityScope(type);

        keyWordBeanDao = new KeyWordBeanDao(keyWordBeanDaoConfig, this);
        taskBeanDao = new TaskBeanDao(taskBeanDaoConfig, this);
        webSiteBeanDao = new WebSiteBeanDao(webSiteBeanDaoConfig, this);

        registerDao(KeyWordBean.class, keyWordBeanDao);
        registerDao(TaskBean.class, taskBeanDao);
        registerDao(WebSiteBean.class, webSiteBeanDao);
    }
    
    public void clear() {
        keyWordBeanDaoConfig.clearIdentityScope();
        taskBeanDaoConfig.clearIdentityScope();
        webSiteBeanDaoConfig.clearIdentityScope();
    }

    public KeyWordBeanDao getKeyWordBeanDao() {
        return keyWordBeanDao;
    }

    public TaskBeanDao getTaskBeanDao() {
        return taskBeanDao;
    }

    public WebSiteBeanDao getWebSiteBeanDao() {
        return webSiteBeanDao;
    }

}
